package com.itheima.crops;

import com.alibaba.fastjson.JSON;
import com.itheima.crops.pojo.PcropsIndexInfo;
import com.itheima.crops.pojo.PcropsIndexInfoVO;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import tk.mybatis.spring.annotation.MapperScan;

import java.util.ArrayList;
import java.util.List;

/**
 * @PackageName com.itheima.system
 * @ProjectName Ceres-Work
 * @Created by Chanly on 2020/10/10 14:57
 **/
@SpringBootApplication
@EnableEurekaClient
@MapperScan("com.itheima.crops.dao")
public class CropsApplication {
    public static void main(String[] args) {
        SpringApplication.run(CropsApplication.class,args);
        PcropsIndexInfoVO pcropsIndexInfoVO = new PcropsIndexInfoVO();
        List<PcropsIndexInfo> pcropsIndexInfos = new ArrayList<>();
        PcropsIndexInfo pcropsIndexInfo = new PcropsIndexInfo();
        pcropsIndexInfo.setIid(1L);
        pcropsIndexInfo.setSuit("3-5");
        pcropsIndexInfos.add(pcropsIndexInfo);
        PcropsIndexInfo pcropsIndexInfo1 = new PcropsIndexInfo();
        pcropsIndexInfo1.setIid(2L);
        pcropsIndexInfo1.setSuit("20");
        pcropsIndexInfos.add(pcropsIndexInfo1);
        pcropsIndexInfoVO.setPcropsIndexInfos(pcropsIndexInfos);
        String json = JSON.toJSONString(pcropsIndexInfoVO);
        System.out.println("json = " + json);

    }
}
